cmake_minimum_required(VERSION 2.8)

SET(PRJ_NAME 				ncsds)
SET(PRJ_ROOTDIR				${CMAKE_CURRENT_SOURCE_DIR} )
SET(SRCDIR 					${PRJ_ROOTDIR}/src )

PROJECT(${PRJ_NAME} 		C CXX)
MESSAGE(STATUS "Building ncurses desktop GUI library and demo")
MESSAGE(STATUS "Usage: 'g' + arrows, 'm' + arrows")

INCLUDE_DIRECTORIES( 
	"${SRCDIR}"
)

LINK_DIRECTORIES(
	"${PRJ_ROOTDIR}/build"
	"${CMAKE_CURRENT_BINARY_DIR}"
)
	#SET(cflags	-std=gnu99 )
	#SET(cxxflags -std=c++11 )
	ADD_DEFINITIONS(${cflags} ${cxxflags})

	SET(SRCLIST_ncsds
		${SRCDIR}/box.cpp              
		${SRCDIR}/desktop.cpp   
		${SRCDIR}/lview.cpp        
		#${SRCDIR}/test1.cpp       
		${SRCDIR}/view.cpp 
		${SRCDIR}/color_pair.cpp       
		${SRCDIR}/event.cpp    
		${SRCDIR}/model.cpp
		${SRCDIR}/controller.cpp       
		${SRCDIR}/geometry.cpp  
		${SRCDIR}/port.cpp         
		${SRCDIR}/timer.cpp 
		${SRCDIR}/controller_item.cpp  
		${SRCDIR}/keyboard.cpp  
		${SRCDIR}/shadow_view.cpp  
		#${SRCDIR}/use_shadow.cpp
	)

	ADD_LIBRARY(ncsds SHARED ${SRCLIST_ncsds})
	TARGET_LINK_LIBRARIES(ncsds -lncursesw)

	#ADD_EXECUTABLE(demo2  	${SRCDIR}/test2.cpp )
	#TARGET_LINK_LIBRARIES(demo2  -lncsds -lstdc++ -lglib-2.0 )
